Optimal. Leaf size=176 \[ -\frac {1}{4} \sqrt {-1+\sqrt {2}} \tan ^{-1}\left (\frac {\sqrt {2 \left (-1+\sqrt {2}\right )}-2 x}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )+\frac {1}{4} \sqrt {-1+\sqrt {2}} \tan ^{-1}\left (\frac {\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )-\frac {\log \left (\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}}+\frac {\log \left (\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 176, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {1108, 648, 632,
210, 642} \begin {gather*} -\frac {1}{4} \sqrt {\sqrt {2}-1} \text {ArcTan}\left (\frac {\sqrt {2 \left (\sqrt {2}-1\right )}-2 x}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )+\frac {1}{4} \sqrt {\sqrt {2}-1} \text {ArcTan}\left (\frac {2 x+\sqrt {2 \left (\sqrt {2}-1\right )}}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )-\frac {\log \left (x^2-\sqrt {2 \left (\sqrt {2}-1\right )} x+\sqrt {2}\right )}{8 \sqrt {\sqrt {2}-1}}+\frac {\log \left (x^2+\sqrt {2 \left (\sqrt {2}-1\right )} x+\sqrt {2}\right )}{8 \sqrt {\sqrt {2}-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1108
Rubi steps
\begin {align*} \int \frac {1}{2+2 x^2+x^4} \, dx &=\frac {\int \frac {\sqrt {2 \left (-1+\sqrt {2}\right )}-x}{\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{4 \sqrt {-1+\sqrt {2}}}+\frac {\int \frac {\sqrt {2 \left (-1+\sqrt {2}\right )}+x}{\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{4 \sqrt {-1+\sqrt {2}}}\\ &=\frac {\int \frac {1}{\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{4 \sqrt {2}}+\frac {\int \frac {1}{\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{4 \sqrt {2}}-\frac {\int \frac {-\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x}{\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{8 \sqrt {-1+\sqrt {2}}}+\frac {\int \frac {\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x}{\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2} \, dx}{8 \sqrt {-1+\sqrt {2}}}\\ &=-\frac {\log \left (\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}}+\frac {\log \left (\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}}-\frac {\text {Subst}\left (\int \frac {1}{-2 \left (1+\sqrt {2}\right )-x^2} \, dx,x,-\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x\right )}{2 \sqrt {2}}-\frac {\text {Subst}\left (\int \frac {1}{-2 \left (1+\sqrt {2}\right )-x^2} \, dx,x,\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x\right )}{2 \sqrt {2}}\\ &=-\frac {\tan ^{-1}\left (\frac {\sqrt {2 \left (-1+\sqrt {2}\right )}-2 x}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )}{4 \sqrt {1+\sqrt {2}}}+\frac {\tan ^{-1}\left (\frac {\sqrt {2 \left (-1+\sqrt {2}\right )}+2 x}{\sqrt {2 \left (1+\sqrt {2}\right )}}\right )}{4 \sqrt {1+\sqrt {2}}}-\frac {\log \left (\sqrt {2}-\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}}+\frac {\log \left (\sqrt {2}+\sqrt {2 \left (-1+\sqrt {2}\right )} x+x^2\right )}{8 \sqrt {-1+\sqrt {2}}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.03, size = 41, normalized size = 0.23 \begin {gather*} \frac {1}{4} \left ((1-i)^{3/2} \tan ^{-1}\left (\frac {x}{\sqrt {1-i}}\right )+(1+i)^{3/2} \tan ^{-1}\left (\frac {x}{\sqrt {1+i}}\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(252\) vs.
\(2(124)=248\).
time = 0.06, size = 253, normalized size = 1.44
method | result | size |
risch | \(\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\textit {\_Z}^{4}+2 \textit {\_Z}^{2}+2\right )}{\sum }\frac {\ln \left (x -\textit {\_R} \right )}{\textit {\_R}^{3}+\textit {\_R}}\right )}{4}\) | \(31\) |
default | \(\frac {\left (\sqrt {-2+2 \sqrt {2}}\, \sqrt {2}+2 \sqrt {-2+2 \sqrt {2}}\right ) \ln \left (x^{2}+\sqrt {2}+x \sqrt {-2+2 \sqrt {2}}\right )}{16}+\frac {\left (2 \sqrt {2}-\frac {\left (\sqrt {-2+2 \sqrt {2}}\, \sqrt {2}+2 \sqrt {-2+2 \sqrt {2}}\right ) \sqrt {-2+2 \sqrt {2}}}{2}\right ) \arctan \left (\frac {2 x +\sqrt {-2+2 \sqrt {2}}}{\sqrt {2+2 \sqrt {2}}}\right )}{4 \sqrt {2+2 \sqrt {2}}}+\frac {\left (-\sqrt {-2+2 \sqrt {2}}\, \sqrt {2}-2 \sqrt {-2+2 \sqrt {2}}\right ) \ln \left (x^{2}+\sqrt {2}-x \sqrt {-2+2 \sqrt {2}}\right )}{16}+\frac {\left (2 \sqrt {2}+\frac {\left (-\sqrt {-2+2 \sqrt {2}}\, \sqrt {2}-2 \sqrt {-2+2 \sqrt {2}}\right ) \sqrt {-2+2 \sqrt {2}}}{2}\right ) \arctan \left (\frac {2 x -\sqrt {-2+2 \sqrt {2}}}{\sqrt {2+2 \sqrt {2}}}\right )}{4 \sqrt {2+2 \sqrt {2}}}\) | \(253\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 249, normalized size = 1.41 \begin {gather*} \frac {1}{16} \cdot 2^{\frac {1}{4}} {\left (\sqrt {2} + 1\right )} \sqrt {-2 \, \sqrt {2} + 4} \log \left (2 \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + 4 \, x^{2} + 4 \, \sqrt {2}\right ) - \frac {1}{16} \cdot 2^{\frac {1}{4}} {\left (\sqrt {2} + 1\right )} \sqrt {-2 \, \sqrt {2} + 4} \log \left (-2 \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + 4 \, x^{2} + 4 \, \sqrt {2}\right ) - \frac {1}{4} \cdot 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 4} \arctan \left (-\frac {1}{2} \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + \frac {1}{4} \cdot 2^{\frac {3}{4}} \sqrt {2 \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + 4 \, x^{2} + 4 \, \sqrt {2}} \sqrt {-2 \, \sqrt {2} + 4} - \sqrt {2} + 1\right ) - \frac {1}{4} \cdot 2^{\frac {1}{4}} \sqrt {-2 \, \sqrt {2} + 4} \arctan \left (-\frac {1}{2} \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + \frac {1}{4} \cdot 2^{\frac {3}{4}} \sqrt {-2 \cdot 2^{\frac {3}{4}} x \sqrt {-2 \, \sqrt {2} + 4} + 4 \, x^{2} + 4 \, \sqrt {2}} \sqrt {-2 \, \sqrt {2} + 4} + \sqrt {2} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 899 vs.
\(2 (151) = 302\).
time = 0.62, size = 899, normalized size = 5.11 \begin {gather*} \sqrt {\frac {1}{64} + \frac {\sqrt {2}}{64}} \log {\left (x^{2} + x \left (- 4 \sqrt {2} \sqrt {1 + \sqrt {2}} - \sqrt {1 + \sqrt {2}} + 3 \sqrt {1 + \sqrt {2}} \sqrt {2 \sqrt {2} + 3}\right ) - 15 \sqrt {2 \sqrt {2} + 3} - 7 \sqrt {2} \sqrt {2 \sqrt {2} + 3} + 29 + 23 \sqrt {2} \right )} - \sqrt {\frac {1}{64} + \frac {\sqrt {2}}{64}} \log {\left (x^{2} + x \left (- 3 \sqrt {1 + \sqrt {2}} \sqrt {2 \sqrt {2} + 3} + \sqrt {1 + \sqrt {2}} + 4 \sqrt {2} \sqrt {1 + \sqrt {2}}\right ) - 15 \sqrt {2 \sqrt {2} + 3} - 7 \sqrt {2} \sqrt {2 \sqrt {2} + 3} + 29 + 23 \sqrt {2} \right )} + 2 \sqrt {- \frac {\sqrt {2 \sqrt {2} + 3}}{32} + \frac {1}{64} + \frac {3 \sqrt {2}}{64}} \operatorname {atan}{\left (\frac {2 x}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} - \frac {4 \sqrt {2} \sqrt {1 + \sqrt {2}}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} - \frac {\sqrt {1 + \sqrt {2}}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} + \frac {3 \sqrt {1 + \sqrt {2}} \sqrt {2 \sqrt {2} + 3}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} \right )} + 2 \sqrt {- \frac {\sqrt {2 \sqrt {2} + 3}}{32} + \frac {1}{64} + \frac {3 \sqrt {2}}{64}} \operatorname {atan}{\left (\frac {2 x}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} - \frac {3 \sqrt {1 + \sqrt {2}} \sqrt {2 \sqrt {2} + 3}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} + \frac {\sqrt {1 + \sqrt {2}}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} + \frac {4 \sqrt {2} \sqrt {1 + \sqrt {2}}}{\sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}} + \sqrt {2 \sqrt {2} + 3} \sqrt {- 2 \sqrt {2 \sqrt {2} + 3} + 1 + 3 \sqrt {2}}} \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.16, size = 143, normalized size = 0.81 \begin {gather*} \frac {1}{4} \, \sqrt {\sqrt {2} - 1} \arctan \left (\frac {2^{\frac {3}{4}} {\left (2 \, x + 2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2}\right )}}{2 \, \sqrt {\sqrt {2} + 2}}\right ) + \frac {1}{4} \, \sqrt {\sqrt {2} - 1} \arctan \left (\frac {2^{\frac {3}{4}} {\left (2 \, x - 2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2}\right )}}{2 \, \sqrt {\sqrt {2} + 2}}\right ) + \frac {1}{8} \, \sqrt {\sqrt {2} + 1} \log \left (x^{2} + 2^{\frac {1}{4}} x \sqrt {-\sqrt {2} + 2} + \sqrt {2}\right ) - \frac {1}{8} \, \sqrt {\sqrt {2} + 1} \log \left (x^{2} - 2^{\frac {1}{4}} x \sqrt {-\sqrt {2} + 2} + \sqrt {2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.21, size = 210, normalized size = 1.19 \begin {gather*} \mathrm {atanh}\left (\frac {4\,\sqrt {2}\,x\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}}{64\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}-1}+\frac {4\,\sqrt {2}\,x\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}}{64\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}-1}\right )\,\left (2\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}-2\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}\right )-\mathrm {atanh}\left (\frac {4\,\sqrt {2}\,x\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}}{64\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}+1}-\frac {4\,\sqrt {2}\,x\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}}{64\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}+1}\right )\,\left (2\,\sqrt {\frac {1}{64}-\frac {\sqrt {2}}{64}}+2\,\sqrt {\frac {\sqrt {2}}{64}+\frac {1}{64}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________